{template header}


<div class="container">
    <div class="row">
        <div class="col-md-12">
        <div class="panel panel-default">
            <div class="panel-body">
                <form id="selectform" class="searchform" method="get" action="{tsUrl('group','vo',array('page'=>$page))}"  enctype="multipart/form-data" >
                     <ul style="padding:10px;display: flex">
                            <input type="hidden" name="app" value="group">
                            <input type="hidden" name="ac" value="vo">
                            <input type="hidden" name="page" value="{$page}">
                           <input type="hidden" name="groupid" value="{$groupid}">
                             <input type="hidden" name="all" value="{$all}">
                         <li style="padding-right: 2px">
                             <select onChange="MM_jumpMenu('parent',this,0)" style="font-size:10px;"  class="form-control">
                                 <option value="{tsUrl('group','vo',array('groupid'=>$groupid,'begintime'=>$begintime,'endtime'=>$endtime,'supporter'=>$supporter,'page'=>$page))}" >待定</option>
                                 <option value="{tsUrl('group','vo',array('groupid'=>$groupid,'all'=>1,'begintime'=>$begintime,'endtime'=>$endtime,'supporter'=>$supporter,'page'=>$page))}" {if $all==1}selected{/if}>含已删</option>
                                 <option value="{tsUrl('group','vo',array('groupid'=>$groupid,'all'=>2,'begintime'=>$begintime,'endtime'=>$endtime,'supporter'=>$supporter,'page'=>$page))}" {if $all==2}selected{/if}>已干预</option>
                                 <option value="{tsUrl('group','vo',array('groupid'=>$groupid,'all'=>3,'begintime'=>$begintime,'endtime'=>$endtime,'supporter'=>$supporter,'page'=>$page))}" {if $all==3}selected{/if}>未干预</option>
                             </select>
                         </li>
                         <li style="padding-right: 2px">
                             <select onChange="MM_jumpMenu('parent',this,0)" style="font-size:10px;font-weight: 300;"  class="form-control">
                                 <option value="{tsUrl('group','vo',array('all'=>$all,'begintime'=>$begintime,'endtime'=>$endtime,'page'=>$page))}">所有干预人</option>
                                 {loop $strSupporter $key $item}
                                 <option value="{tsUrl('group','vo',array('groupid'=>$groupid,'all'=>$all,'begintime'=>$begintime,'endtime'=>$endtime,'supporter'=>$item[userid],'page'=>$page))}" {if $supporter==$item['userid']}selected{/if}>{$item['username']}</option>
                                 {/loop}
                             </select>
                         </li>
                           <li style="padding-right: 2px">
                               <select onChange="MM_jumpMenu('parent',this,0)" style="font-size:10px;font-weight: 300;"  class="form-control">
                                   <option value="{tsUrl('group','vo',array('all'=>$all,'begintime'=>$begintime,'endtime'=>$endtime,'supporter'=>$supporter,'page'=>$page))}">所有分馆</option>
                                   {loop $strGroup $key $item}
                                   <option value="{tsUrl('group','vo',array('groupid'=>$item['groupid'],'all'=>$all,'begintime'=>$begintime,'endtime'=>$endtime,'supporter'=>$supporter,'page'=>$page))}" {if $groupid==$item['groupid']}selected{/if}>{$item['groupname']}</option>
                                   {/loop}
                               </select>
                           </li>

                           <li style="padding-right: 2px">
                               <input class="form-control" name="begintime" readonly value="{if $begintime} {$begintime}{/if}"  id="beginTime" placeholder="开始时间"/>
                           </li>

                           <li style="padding-right: 2px">
                               <input class="form-control" name="endtime" readonly value="{if $endtime} {$endtime}{/if}" id="endTime" placeholder="结束时间"/>
                           </li>

                         <li>
                           <input class="btn btn-group-sm" type="submit" value="查询">
                         </li>
                     </ul>
                </form>
                <h3 style="padding: 20px 0 10px 0px;text-align: center;" >
                  <div style="font-weight: 500">{$title}</div><br/><span class="menu">合计：{$stockNum}</span>

                </h3>
                <div class="duty_index_list" style="padding-left: 20px">

                    {if $strStock}
                    {if isMobile()}

                    {loop $strStock $key $item}
                    <div class="topic_list" style="padding-bottom:10px" >
                        <div style="padding-top:10px"><img src="{$item[user][face]}" width="15" height="15"><a href="{tsUrl('user','comment',array('id'=>$item[userid],'groupid'=>$item[groupid]))}" style="{if $item[isvo]==-2}text-decoration:line-through;color: #999999 {/if}"> {$item[user][username]}</a>  {$item[phone]}</div>
                        <div style="{if $item[isvo]==-2}text-decoration:line-through;color: #999999 {/if}">{php echo(date('Y-m-d H:i',$item[addtime]))}报名<a href="{tsUrl('group','show',array('id'=>$item[groupid]))}" style="{if $item[isvo]==-2}text-decoration:line-through;color: #999999 {/if}"> {$item[group][groupname]}</a>馆员</div>
                        <div style="{if $item[isvo]==-2}text-decoration:line-through;color: #999999 {/if}" onclick="jump('{php echo(tsUrl('user','comment',array('id'=>$item[userid],'groupid'=>$item[groupid],'type'=>1)))}')">{if $item[memo]}{$item[memo][content]}{else}无备注，打捞后请点击这里写备注{/if}</div>
                        <div>{if $item[supportername]}{$item[supportername]}{if $item[uptime]}于{php echo getTime($item[uptime],time())}{/if}最后一次{else}无人{/if}打捞</div>
                        <div style="float: right">
                            {if $item[supporttype]==0}
                            <a href="javascript:void('0');" onclick="save('{$item[groupid]}','{$item[userid]}',1)" title="申请加微信了"><i class="fa fa-wechat"></i></a>
                            &nbsp;&nbsp;&nbsp;&nbsp;
                            {/if}
                            {if $item[supporttype]==0||$item[supporttype]==1}
                            <a href="javascript:void('0');" onclick="save('{$item[groupid]}','{$item[userid]}',2)" title="微信留言了"><i class="fa fa-sticky-note-o"></i></a>
                            &nbsp;&nbsp;&nbsp;&nbsp;
                            {/if}
                            {if $item[supporttype]>=0&&$item[supporttype]<=2}
                            <a href="javascript:void('0');" onclick="save('{$item[groupid]}','{$item[userid]}',3)" title="手机搜不到微信"><i class="fa fa-mobile"></i></a>
                            &nbsp;&nbsp;&nbsp;&nbsp;
                            {/if}
                            {if $item[supporttype]>=0&&$item[supporttype]<=3}
                            <a href="javascript:void('0');" onclick="save('{$item[groupid]}','{$item[userid]}',4)" title="打电话了"><i class="fa fa-phone"></i></a>
                            &nbsp;&nbsp;&nbsp;&nbsp;
                            {/if}
                            <a href="javascript:void('0');" onclick="save('{$item[groupid]}','{$item[userid]}')" ><i class="fa fa-check"></i></a>
                            &nbsp;&nbsp;&nbsp;&nbsp;

                            <a href="javascript:void('0');" onclick="cancelvo('{$item[groupid]}','{$item[userid]}')" ><i class="fa fa-times"></i></a>
                        </div>

                    </div>


                    {/loop}
                    {else}
                    <table width="100%" class="menu">
                        <tr style="height: 30px;">
                        <td width="8%">姓名</td><td width="10%">报名日期</td><td width="6%">所在分馆</td><td width="10%">手机号</td><td width="25%">备注</td><td width="6%">干预人</td><td width="10%">干预时间</td> <td width="15%">操作</td>
                        </tr>


                        {loop $strStock $key $item}
                            <tr style="height: 30px;{if $item[isvo]==-2}background-color: orange{/if}{if $item[wechat]==1}background-color: #00CC00{/if}">
                           <td width="8%"><img src="{$item[user][face]}" width="15" height="15"><a href="{tsUrl('user','comment',array('id'=>$item[userid],'groupid'=>$item[groupid]))}" style="{if $item[isvo]==-2}text-decoration:line-through;color: #999999 {/if}"> {$item[user][username]}</a></td>
                                <td width="10%" style="{if $item[isvo]==-2}text-decoration:line-through;color: #999999 {/if}">{php echo(date('YmdHi',$item[addtime]))}</td>
                                <td width="6%" ><a href="{tsUrl('group','show',array('id'=>$item[groupid]))}" style="{if $item[isvo]==-2}text-decoration:line-through;color: #999999 {/if}"> {$item[group][groupname]}</a></td>

                            <td width="10%" style="{if $item[isvo]==-2}text-decoration:line-through;color: #999999 {/if}">{$item[phone]}</td>
                            <td width="25%" style="{if $item[isvo]==-2}text-decoration:line-through;color: #999999 {/if}" onclick="jump('{php echo(tsUrl('user','comment',array('id'=>$item[userid],'groupid'=>$item[groupid],'type'=>1)))}')">{if $item[memo]}{$item[memo][content]}{else}无备注，打捞后请点击这里写备注{/if}</td>
                            <td width="6%">{$item[supportername]}</td>
                            <td width="10%">{if $item[uptime]}{php echo getTime($item[uptime],time())}{/if}</td>
                           <td width="15%">

                               {if $item[supporttype]==0}
                               <a href="javascript:void('0');" onclick="save('{$item[groupid]}','{$item[userid]}',1)" title="申请加微信了"><i class="fa fa-wechat"></i></a>
                               &nbsp;&nbsp;&nbsp;&nbsp;
                               {/if}
                               {if $item[supporttype]==0||$item[supporttype]==1}
                               <a href="javascript:void('0');" onclick="save('{$item[groupid]}','{$item[userid]}',2)" title="微信留言了"><i class="fa fa-sticky-note-o"></i></a>
                               &nbsp;&nbsp;&nbsp;&nbsp;
                               {/if}
                               {if $item[supporttype]>=0&&$item[supporttype]<=2}
                               <a href="javascript:void('0');" onclick="save('{$item[groupid]}','{$item[userid]}',3)" title="手机搜不到微信"><i class="fa fa-mobile"></i></a>
                               &nbsp;&nbsp;&nbsp;&nbsp;
                               {/if}
                               {if $item[supporttype]>=0&&$item[supporttype]<=3}
                               <a href="javascript:void('0');" onclick="save('{$item[groupid]}','{$item[userid]}',4)" title="打电话了"><i class="fa fa-phone"></i></a>
                               &nbsp;&nbsp;&nbsp;&nbsp;
                               {/if}
                               <a href="javascript:void('0');" onclick="save('{$item[groupid]}','{$item[userid]}')" ><i class="fa fa-check"></i></a>
                               &nbsp;&nbsp;&nbsp;&nbsp;

                               <a href="javascript:void('0');" onclick="cancelvo('{$item[groupid]}','{$item[userid]}')" ><i class="fa fa-times"></i></a>
                           </td>


                         </tr>
                        {/loop}

                        </table>
                    {/if}
                    {else}
                    <div>没有记录</div>
                    {/if}
                    <div class="page">{$pageUrl}</div>
                </div>
            </div>

    </div>
    </div>
</div>
</div>

<script>






    $('#beginTime').datetimepicker({
        language:  'zh-CN',
        format: 'yyyy-mm-dd',
        autoclose: true,
        minView:2
    });

    $('#endTime').datetimepicker({
        language:  'zh-CN',
        format: 'yyyy-mm-dd',
        autoclose: true,
        minView:2
    });



    //设置为已入群
    function save(groupid,userid,type){
        switch(type){
            case 1:
                text = '确认已申请加微信了吗';
                break;
            case 2:
                text = '确认已加微信留言了吗';
                break;
            case 3:
                text = '确认手机搜不到微信吗';
                break;
            case 4:
                text = '确认已打电话了吗';
                break;
            default:
                text = '确认此人已入群了吗？';
                break;
        }
        if (confirm(text)){
            $.post(siteUrl+'index.php?app=group&ac=user&ts=save',{'groupid':groupid,'userid':userid,'type':type},function(rs){
                if (rs == '0') {
                    tsNotice('非法操作！')

                } else if (rs == '1') {

                    window.location.reload();

                }
            })
        }
    }



    //取消修改选馆东
    function cancelvo(groupid,userid){
        if (confirm('取消此人候选馆员身份吗？')){
            $.post(siteUrl+'index.php?app=group&ac=ajax&ts=cancelvo',{'groupid':groupid,'userid':userid},function(rs){
                if (rs == '0') {

                    tsNotice('非法操作！')

                } else if (rs == '1') {

                    window.location.reload();

                }
            })
        }
    }


</script>

{template footer}